home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacApp Release 10 / MacApp Release 10 - HD Ready / Libraries / Framework / Includes / UFloatWindow.h < prev    next >
Encoding:
Text File  |  1996-04-03  |  4.5 KB  |  117 lines  |  [TEXT/MPS ]

  1. // UFloatWindow.h
  2. // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
  3.  
  4. #ifndef __UFLOATWINDOW__
  5. #define __UFLOATWINDOW__
  6.  
  7. //----------------------------------------------------------------------------------------
  8. // Theory of Operation
  9. //  
  10. // UFloatWindow a number of services to support floating windows, including the
  11. // TFloatWindow base class which provides floating window capabilities to MacApp windows.
  12. // Floating windows are distinguished from other windows in the application heap by the
  13. // value of the windowKind field of the windowPeek record. The windowKind values 128-999
  14. // are reserved by MacApp. For now, windowKind values of 128 are used to indicate that a
  15. // window is a floating window.
  16. //
  17. // To use this unit, call InitUFloatWindow from your main program (i.e.
  18. // M<your>Application.cp) after calling InitUMacApp. This routine ensures that the class
  19. // TFloatWindow is registered so it can be created by name from strings in view resources, 
  20. // and sets gUFloatWindowInitialized to true.
  21. //
  22. // N.B.: The MacApp team wishes to thank Dean Yu for the use of his excellent DEVELOP
  23. // article and source code to support floating window operation.
  24. //
  25. // To create a floating window:
  26. //
  27. // For template views, it's business as usual: specify the name of the window class,
  28. // "TFloatWindow", in the window's view description resource and call NewTemplateWindow
  29. // as usual. 
  30. //
  31. // For non-template views, call this unit's NewFloatPaletteWindow, instead of
  32. // NewPaletteWindow; call this unit's NewFloatSimpleWindow, instead of NewSimpleWindow;
  33. // and call this unit's NewFloatTWindow, instead of NewTWindow. 
  34. //
  35. // You probably want to use the floating windoid WDEF so you get something that looks
  36. // like a standard floating window. For this you need to use the definitions in
  37. // "FloatWindow.h". See DemoDialogs for examples. 
  38. //----------------------------------------------------------------------------------------
  39.  
  40. // MacApp
  41.  
  42. #ifndef __UWINDOW__
  43. #include "UWindow.h"
  44. #endif
  45.  
  46.  
  47. //----------------------------------------------------------------------------------------
  48. // Forward and external class declarations. 
  49. //----------------------------------------------------------------------------------------
  50.  
  51. class TDocument;
  52.  
  53. //----------------------------------------------------------------------------------------
  54. // Object Signatures: These follow the same reservation rules as resource types The
  55. // signature is used to search the signature table and create an object "by signature"If
  56. // the signature's entry in the table has been updated with a new class then an object of
  57. // that class will be created.
  58. //----------------------------------------------------------------------------------------
  59.  
  60. const IDType kStdFloatWindow = 'fwnd';
  61.  
  62. //----------------------------------------------------------------------------------------
  63. // TFloatWindow
  64. //----------------------------------------------------------------------------------------
  65.  
  66. class TFloatWindow : public TWindow
  67. {
  68.     MA_DECLARE_CLASS;
  69.     
  70. public:
  71.     TFloatWindow();
  72.         // Constructor
  73.     virtual ~TFloatWindow();
  74.         // Destructor
  75.         
  76.     void IFloatWindow(TDocument* itsDocument,
  77.                                      WindowRef itsWMgrWindow,
  78.                                      Boolean canResize,
  79.                                      Boolean canClose,
  80.                                      Boolean disposeOnFree);
  81.  
  82.     //------------------------------------------------------------------------------------
  83.     // Standard signature support.
  84.     //------------------------------------------------------------------------------------
  85.  
  86.     virtual IDType GetStandardSignature();    // override 
  87.         // Returns this class's standard signature.
  88.  
  89.     //------------------------------------------------------------------------------------
  90.     // Stream I/O protocol support.
  91.     //------------------------------------------------------------------------------------
  92.  
  93.     virtual void ReadFields(TStream* aStream);
  94.     
  95.     virtual WindowRef GetBehindWindowPtr();
  96.         // returns WindowRef(-1)
  97.  
  98.     virtual void Close();    // Override 
  99.         // Overridden to fix up the target, since no deactivation occurs
  100. };
  101.  
  102.  
  103. //----------------------------------------------------------------------------------------
  104. // Global function declaraions
  105. //----------------------------------------------------------------------------------------
  106.  
  107. extern void InitUFloatWindow();
  108.     // Unit initialization
  109.  
  110. //----------------------------------------------------------------------------------------
  111. // Global variable declarations
  112. //----------------------------------------------------------------------------------------
  113.  
  114. extern Boolean gUFloatWindowInitialized;
  115.  
  116. #endif
  117.